/**
 * Copyright (C) 2018-2021
 * All rights reserved, Designed By www.yixiang.co

 */
package co.yixiang.modules.activity.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import co.yixiang.domain.BaseDomain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
* @author hupeng
* @date 2020-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName("yx_store_pink")
public class YxStorePink extends BaseDomain {

    @TableId
    @ApiModelProperty(value = "拼团产品ID")
    private Long id;


    /** 用户id */
    @ApiModelProperty(value = "拼团产品用户ID")
    private Long uid;


    /** 订单id 生成 */
    @ApiModelProperty(value = "拼团产品订单ID 生成")
    private String orderId;


    /** 订单id  数据库 */
    @ApiModelProperty(value = "拼团产品订单id  数据库")
    private Long orderIdKey;


    /** 购买商品个数 */
    @ApiModelProperty(value = "购买商品个数")
    private Integer totalNum;


    /** 购买总金额 */
    @ApiModelProperty(value = "购买总金额")
    private BigDecimal totalPrice;


    /** 拼团产品id */
    @ApiModelProperty(value = "拼团产品id")
    private Long cid;


    /** 产品id */
    @ApiModelProperty(value = "产品id")
    private Long pid;


    /** 拼团总人数 */
    @ApiModelProperty(value = "拼团总人数")
    private Integer people;


    /** 拼团产品单价 */
    @ApiModelProperty(value = "拼团产品单价")
    private BigDecimal price;

    /** 拼团产品停止时间 */
    @ApiModelProperty(value = "拼团产品停止时间")
    private Date stopTime;


    /** 团长id 0为团长 */
    @ApiModelProperty(value = "拼团产品团长id 0为团长")
    private Long kId;


    /** 是否发送模板消息0未发送1已发送 */
    @ApiModelProperty(value = "是否发送模板消息0未发送1已发送")
    private Integer isTpl;


    /** 是否退款 0未退款 1已退款 */
    @ApiModelProperty(value = "是否退款 0未退款 1已退款")
    private Integer isRefund;


    /** 状态1进行中2已完成3未完成 */
    @ApiModelProperty(value = "状态1进行中2已完成3未完成")
    private Integer status;

    @ApiModelProperty(value = "库存唯一值")
    private String uniqueId;

    public static YxStorePinkBuilder builder() {
        return new YxStorePinkBuilder();
    }

    public void copy(YxStorePink source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static class YxStorePinkBuilder {
        private Long id;
        private Long uid;
        private String orderId;
        private Long orderIdKey;
        private Integer totalNum;
        private BigDecimal totalPrice;
        private Long cid;
        private Long pid;
        private Integer people;
        private BigDecimal price;
        private Date stopTime;
        private Long kId;
        private Integer isTpl;
        private Integer isRefund;
        private Integer status;
        private String uniqueId;

        YxStorePinkBuilder() {
        }

        public YxStorePinkBuilder id(Long id) {
            this.id = id;
            return this;
        }

        public YxStorePinkBuilder uid(Long uid) {
            this.uid = uid;
            return this;
        }

        public YxStorePinkBuilder orderId(String orderId) {
            this.orderId = orderId;
            return this;
        }

        public YxStorePinkBuilder orderIdKey(Long orderIdKey) {
            this.orderIdKey = orderIdKey;
            return this;
        }

        public YxStorePinkBuilder totalNum(Integer totalNum) {
            this.totalNum = totalNum;
            return this;
        }

        public YxStorePinkBuilder totalPrice(BigDecimal totalPrice) {
            this.totalPrice = totalPrice;
            return this;
        }

        public YxStorePinkBuilder cid(Long cid) {
            this.cid = cid;
            return this;
        }

        public YxStorePinkBuilder pid(Long pid) {
            this.pid = pid;
            return this;
        }

        public YxStorePinkBuilder people(Integer people) {
            this.people = people;
            return this;
        }

        public YxStorePinkBuilder price(BigDecimal price) {
            this.price = price;
            return this;
        }

        public YxStorePinkBuilder stopTime(Date stopTime) {
            this.stopTime = stopTime;
            return this;
        }

        public YxStorePinkBuilder kId(Long kId) {
            this.kId = kId;
            return this;
        }

        public YxStorePinkBuilder isTpl(Integer isTpl) {
            this.isTpl = isTpl;
            return this;
        }

        public YxStorePinkBuilder isRefund(Integer isRefund) {
            this.isRefund = isRefund;
            return this;
        }

        public YxStorePinkBuilder status(Integer status) {
            this.status = status;
            return this;
        }

        public YxStorePinkBuilder uniqueId(String uniqueId) {
            this.uniqueId = uniqueId;
            return this;
        }

        public YxStorePink build() {
            return new YxStorePink(id, uid, orderId, orderIdKey, totalNum, totalPrice, cid, pid, people, price, stopTime, kId, isTpl, isRefund, status, uniqueId);
        }

        public String toString() {
            return "YxStorePink.YxStorePinkBuilder(id=" + this.id + ", uid=" + this.uid + ", orderId=" + this.orderId + ", orderIdKey=" + this.orderIdKey + ", totalNum=" + this.totalNum + ", totalPrice=" + this.totalPrice + ", cid=" + this.cid + ", pid=" + this.pid + ", people=" + this.people + ", price=" + this.price + ", stopTime=" + this.stopTime + ", kId=" + this.kId + ", isTpl=" + this.isTpl + ", isRefund=" + this.isRefund + ", status=" + this.status + ", uniqueId=" + this.uniqueId + ")";
        }
    }
}
